package com.baorun.test.web.controller;

import com.baorun.entity.Result;
import com.baorun.test.web.controller.web.openFeign.ProviderOpenFeignService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author: wang
 * @date: 2021/9/1 10:36
 * @description:
 */
@RestController
public class BookController {

    //@Resource
    //private RestTemplate restTemplate;

    @Resource
    private ProviderOpenFeignService providerOpenFeignService;

    //private static  final String PROVIDER01 = "http://localhost:8001/book";
    //private static  final String PROVIDER01 = "http://provider8001/book";
    private static  final String PROVIDER01 = "http://PROVIDER80/book";


    @GetMapping("/consumer02/book")
    public Result queryBooks(){
        return providerOpenFeignService.queryBooks();
    }

}
